<?php
session_start();
header("Content-type: text/html; charset=utf-8");
require 'core.php';
require 'define.php';
core::init(array(
'autoload_enable' => true,
'autoload_prepend' => true,
'autoload_path' => '@modules/admin',
'framework_enable' => 'final',
'framework_module' => '[go]|admin!(self)',
'framework_action' => '[do]|index',
'template_path' => '@tpl_admin',
'connect_server' => DB_HOST,
'connect_username' => DB_USER,
'connect_password' => DB_PASS,
'connect_dbname' => DB_NAME,
'connect_charset' => DB_CHARSET,
'sql_format' => true,
'debug_file'=>'sql.log',
'debug_enable'=>DEBUG_SET,
));

if (core::stub()) {

   $module_action = core::main('final,static,module,action');
   if ($module_action[1]) {
     switch($module_action[1]){
     	case 'code':
          call_user_func($module_action);
          break;
        default:
           // core::view( 'admin/templates/header.tpl');
            call_user_func($module_action);
           // core::view( 'admin/templates/footer.tpl');
            break;
     }
   } else {
     core::main(false);
   }
}
?>